import request from '@/utils/http'

// 获取购物车列表
export const getCartAPI = () => {
  return request({
        url: '/member/cart'
    })
}

// 添加到购物车
export const addCartAPI = (data) => {
  return request({
    url: '/member/cart',
    method: 'POST',
    data
  })
}

// 删除购物车商品
export const delCartAPI = (id) => {
  return request({
    url: `/member/cart/${id}`,
    method: 'DELETE'
  })
}

// 修改购物车商品
export const updateCartAPI = (id, data) => {
  return request({
    url: `/member/cart/${id}`,
    method: 'PUT',
    data
  })
}
